home *** CD-ROM | disk | FTP | other *** search
/ Graphics Bonanza / Graphics Bonanza.iso / prog2 / wgt35 / wgtref.doc < prev    next >
Encoding:
Text File  |  1993-01-28  |  11.9 KB  |  512 lines

  1.         WordUp Graphics Toolkit Version 3.5
  2.             Quick Reference Guide
  3.  
  4.  
  5. Initialization:
  6. ~~~~~~~~~~~~~~~
  7. void vga256(void)
  8.         Initialize the graphics mode 320x200x256
  9.  
  10.  
  11. Graphics Primitives
  12. ~~~~~~~~~~~~~~~~~~~
  13. void wbar(int x1,int y1,int x2,int y2)
  14.         Draws a filled rectangle
  15.  
  16. void wbutt(int x1,int y1,int x2,int y2)
  17.         Draws a 3-Dimensional button
  18.  
  19.  
  20. void wcircle(int x,int y,int radius)
  21.         Draws a hollow circle
  22.  
  23. void wclip(int x1,int y1,int x2,int y2)
  24.         Sets clipping variables
  25.  
  26. void wcls(int color)
  27.         Clears the screen with a color
  28.  
  29. void wfastputpixel(int x,int y)
  30.         Fastest pixel write to the screen (no clipping)
  31.  
  32. void wfill_circle(int x,int y,int radius)
  33.         Draws a filled circle
  34.  
  35. void wfline(int x,int y,int x2,int y2)
  36.         Fast line draw
  37.  
  38. void wgetpixel(int x,int y);
  39.         Reads a pixel from the screen
  40.  
  41. void wline(int x1,int y1,int x2,int y2)
  42.         Draws a line from pt x1,y1 to x2,y2
  43.  
  44. void wputpixel(int x,int y)
  45.         Writes a pixel to the screen
  46.  
  47. void wrectangle(int x1,int y1,int x2,int y2)
  48.         Draws a rectangle
  49.  
  50. void wregionfill(int x,int y)
  51.         Fills using the current colour
  52.  
  53. void wretrace(void)
  54.         Waits for a vertical retrace
  55.  
  56. void wstyleline(int x1,int y1,int x2,int y2,unsigned int style);
  57.         Draws a styled line.
  58.  
  59.  
  60.  
  61. Colours and Palettes
  62. ~~~~~~~~~~~~~~~~~~~~
  63. void wcolrotate(int start,int finish,int direction,color palette[255])
  64.         Rotates colours
  65.  
  66. void wfade_in(int start,int finish,int speed, color palette[255]);
  67.         Fades from black to colours in palette
  68.  
  69. void wfade_out(int start,int finish,int speed,color palette[255]);
  70.         Fades from colours in palette to black
  71.  
  72. void wloadpalette(char *filename,color *palette)
  73.         Loads a palette file from disk
  74.  
  75. void wreadpalette(int start,int finish, color *palette)
  76.         Reads the current palette in array
  77.  
  78. void wremap(color *pal1,block remapblock,color *pal2)
  79.         Remaps one palette onto another.
  80.  
  81. void wsavepalette(char *filename, color *palette);
  82.         Save a palette file to disk
  83.  
  84. void wsetcolor(int color)
  85.         Sets current drawing colour
  86.  
  87. void wsetpalette(int start,int finish, color *palette)
  88.         Sets part or all of the palette
  89.  
  90.  
  91. void wsetrgb(int color,int red,int green, int blue, color *palette)
  92.         Sets an individual colour, doesn't change until wsetpalette        
  93.  
  94.  
  95.  
  96.  
  97.  
  98. Image Transfer
  99. ~~~~~~~~~~~~~~
  100. void wflipblock(block blockname, int direction);
  101.         Flips a previously allocated block
  102.  
  103. void wfreeblock(block blockname)
  104.         Frees memory from block
  105.  
  106. int wgetblockheight(block blockname);
  107.         Returns the height of the block
  108.  
  109. int wgetblockwidth(block blockname);
  110.         Returns the width of the block
  111.  
  112. block wloadblock(char *filename)
  113.         Loads block from disk,  allocates memory automatically
  114.  
  115. block wloadcel(char *filename, color *palette);
  116.         Loads a CEL file into a block, allocs memory
  117.  
  118. block wloadpak(char *filename)
  119.         Loads a PAK files from disk, allocates block
  120.  
  121. block wloadpcx256(char *filename, color *palette);
  122.         Loads a PCX file to the screen
  123.  
  124. block wnewblock(int x1,int y1,int x2,int y2)
  125.         Allocates and grabs an image
  126.  
  127. void wputblock(int x,int y, block blockname, int mode)
  128.         Pastes a block on the screen, in copy or xray modes
  129.  
  130. int wsaveblock(char *filename, block blockname)
  131.         Saves a block to disk
  132.  
  133. void wsavecel(char *filename,block saveblock,color palette[256]);
  134.         Saves a block in CEL format
  135.  
  136. int wsavepak(char *filename,block blockname)
  137.         Saves a block in PAK format
  138.  
  139. void wsavepcx256(char *filename,block blockname,color *pcxpal)
  140.         Saves a block in PCX format
  141.  
  142.  
  143.  
  144.  
  145. Mouse Control
  146. ~~~~~~~~~~~~~
  147. int minit(void);
  148.         Initializes mouse, returns number of buttons    
  149.  
  150. void moff(void)
  151.         Turns the mouse cursor off
  152.  
  153. void mon(void)
  154.         Turns the mouse cursor on
  155.  
  156. void mouseshape(int rowhot,int colhot, void far *bitmap)
  157.         Change the hotspot and shape of the mouse cursor
  158.  
  159. void mread(void)
  160.         Reads mouse coordinates and button state into mx,my,but
  161.  
  162. void msetbounds(int minx,int miny,int maxx,int maxy)
  163.         Sets the range the mouse cursor moves in
  164.  
  165. void msetspeed(int x_speed,int y_speed)
  166.         Adjusts the vertical and horizontal mouse speed
  167.  
  168. void msetthreshhold(int speed)
  169.         Sets which speed doubles the mouse movement
  170.  
  171. void noclick(void)
  172.         Loops until all mouse buttons are released
  173.  
  174.  
  175. Screen Manipulation
  176. ~~~~~~~~~~~~~~~~~~~
  177. void wcopyscreen(int x1,int y1,int x2,int y2,block source,int dx,int dy,
  178.              block dest)
  179.         Copy an area of a page to another location on same or
  180.         different page. Pass NULL as source or dest to copy to or
  181.         from visual page
  182.  
  183. void wnormscreen(void)
  184.         Sets active drawing page to visual page
  185.  
  186. void wsetscreen(block screenname)
  187.         Sets active drawing page to a full screen block
  188.  
  189.  
  190. Text and Fonts
  191. ~~~~~~~~~~~~~~
  192. void wflashcursor(void)
  193.         Flashes the similated text cursor once
  194.  
  195. void wfreefont(wgtfont yourfont)
  196.         Frees memory from a previously loaded font
  197.  
  198. int wgettextheight(char *printme,wgtfont prfont)
  199.         Returns the height of the tallest letter in the string
  200.  
  201. int wgettextwidth(char *printme,wgtfont prfont)
  202.         Returns the width of the entire string
  203.  
  204. void wgtprintf(int xloc,int yloc,wgtfont wgtprfon,char *fmt, ... )
  205.         Allows printf commands in graphics mode
  206.  
  207. wgtfont wloadfont(char *fontfile)
  208.         Loads and allocates memory for a custom font
  209.  
  210. void wouttextxy(int x,int y, char *string,wgtfont font)
  211.         Displays a string at screen coordinates
  212.  
  213. void wsetcursor(int y,int y2)
  214.         Sets the height of the text cursor
  215.  
  216. int wstring(int x,int y, char *instring, char *legal, int num)
  217.         Inputs a text string using the normal font
  218.  
  219. void wtextbackground(unsigned char color)
  220.         Sets the background text colour
  221.  
  222. void wtextcolor(unsigned char color)
  223.         Sets the foreground text colour
  224.  
  225. void wtextgrid(int state)
  226.         Turns the text grid on or off
  227.  
  228. void wtexttransparent(int mode)
  229.         Turns text foreground or background on or off
  230.  
  231.  
  232. Special Effects
  233. ~~~~~~~~~~~~~~~
  234. void wfade(block sourcescreen, int *pattern, int speed)
  235.         Fades a screen in, using a custom made pattern
  236.  
  237. void wmovescreen(int x1,int y1, int x2,iny y2,int direction,int speed)
  238.         Moves a screen area in a direction
  239.  
  240. void wpan(int offset)
  241.         Changes the offset of the visual screen
  242.  
  243. void wresize(int x1,int y1,int x2,int y2, block blockname);
  244.         Changes the size of a block on the screen
  245.  
  246. void wskew(int x,int y,block skewblock,int degrees)
  247.         Horizontally skews a block on the screen
  248.  
  249. void wsline(int x1,int y1,int x2,int y2,int *ptarray);
  250.         Stores points on a line into an array. (used for wwarp)
  251.  
  252. void wvertres(int x1,int y1,int y2, block blockname);
  253.         Vertically resizes a block
  254.  
  255. void wwarp(int x1,int x2,int *top,int *bot, block blockname);
  256.         Warps a block by using different resize rates
  257.  
  258. void wwipe(int x1,int y1, int x2,iny y2,block screen)
  259.         Draws a line using colours from a hidden page
  260.  
  261.  
  262.  
  263. FLI Routines
  264. ~~~~~~~~~~~~
  265. void closefli(void);
  266.         Close FLI file
  267.  
  268. void copyfli(void);
  269.         Copy fliscreen to visual screen
  270.  
  271. void openfli(char *filename);
  272.         Opens and initializes FLI file
  273.  
  274. void nextframe(void);
  275.         Reads next frame of FLI file onto fliscreen
  276.  
  277.  
  278.  
  279.  
  280. Sprites
  281. ~~~~~~~
  282. void wfreesprites(block sprites[1001]);
  283.         Frees sprite array
  284.  
  285. int wloadsprites(color *palette,char *filename,block sprites[1001]);
  286.         Loads a sprite file, created with WGT Sprite Creator
  287.  
  288.  
  289.  
  290. Sprite Library
  291. ~~~~~~~~~~~~~~
  292. void animate(int spritenum,char *animation sequence);
  293.         Sets animation for a sprite
  294.  
  295. void animoff(int spritenum);
  296.         Turns off animation for a sprite
  297.  
  298. void animon(int spritenum);
  299.         Turns on animation for a sprite
  300.  
  301. void initspr(void);
  302.         Initializes sprite movement and animation library
  303.  
  304. void movex(int spritenum,char *movement sequence);
  305.         Sets horizontal movement for a sprite
  306.  
  307. void movey(int spritenum,char *movement sequence);
  308.         Sets vertical movement for a sprite
  309.  
  310. void movexoff(int spritenum);
  311.         Turns off horizontal movement for a sprite
  312.  
  313. void movexon(int spritenum);
  314.         Turns on horizontal movement for a sprite
  315.  
  316. void moveyoff(int spritenum);
  317.         Turns off vertical movement for a sprite
  318.  
  319. void moveyon(int spritenum);
  320.         Turns on vertical movement for a sprite
  321.  
  322. int overlap(int spritenum_1,int spritenum_2);
  323.         Checks for a collision between two sprites
  324.  
  325. void spriteon(int spritenum,int x coord,int y coord,int number);
  326.         Turns sprite on
  327.  
  328. void spriteoff(int spritenum);
  329.         Turns sprite off
  330.  
  331.  
  332.  
  333. Drop down menus
  334. ~~~~~~~~~~~~~~~
  335. int checkmenu(void);
  336.         Loops until user clicks mouse button on menu
  337.  
  338. void initdropdowns(void);
  339.         Initializes drop down menus
  340.  
  341. void removemenubar(void);
  342.         Removes top menu bar
  343.  
  344. void showmenubar(void);
  345.         Shows top menu bar
  346.  
  347.  
  348.  
  349. Graphical File Selector
  350. ~~~~~~~~~~~~~~~~~~~~~~~
  351.  
  352. char *wfileselector(char *oper,char *search)
  353.         Calls the graphical file selector
  354.         Oper is a text string to display on top of selector
  355.         Search is the file mask (*.spr, *.doc  etc)
  356.  
  357.  
  358. 4-way Scrolling
  359. ~~~~~~~~~~~~~~~
  360. void installkbd(void);
  361.         Install the custom keyboard interrupt
  362.  
  363. void soverlap(int obj1,int obj2);
  364.         Detect collisions of scrolling objects
  365.  
  366. void uninstallkbd(void);
  367.         Remove the custom keyboard interrupt
  368.  
  369. void wcopyscroll(int x,int y);
  370.         Copies scrolled screen to visual screen
  371.  
  372. void wendscroll(void);
  373.         Shut down 4-way scrolling system
  374.  
  375. void wfreemap(wgtmap mymap);
  376.         Frees memory from a previously loaded map
  377.  
  378. int wgetworldblock(int posx,int posy,wgtmap mymap);
  379.         Read a tile from a position on the map
  380.  
  381. void winitscroll(int window_x_size,int window_y_size);
  382.         Initializes scrolling window
  383.  
  384. wgtmap wloadmap(char *filename);
  385.         Loads and allocates a map made from WGT map maker
  386.  
  387. void wputworldblock(int posx,int posy ,int blocknum,wgtmap mymap);
  388.         Puts a tile onto the map
  389.         (Use World Coords)
  390.  
  391. void wsavemap(char *filename,wgtmap savemap);
  392.         Saves a map file, for saving games
  393.  
  394. void wscrollwindow(int x_speed,int y_speed, wgtmap mymap);
  395.         Scroll the window in any direction
  396.  
  397. void wshowobjects(void);
  398.         Show objects on top of scrolling background
  399.  
  400. void wshowwindow(int posx,int posy ,wgtmap mymap);
  401.         Look at world at coordinates, used for warping player
  402.         to new spot on map.
  403.  
  404.  
  405.  
  406.  
  407. WGT Library
  408. ~~~~~~~~~~~
  409. char *getlib(void)
  410.         Returns the library filename
  411.  
  412. void *lib2buf(char *filename)
  413.         Loads a file from the WGT library file, returns a pointer
  414.  
  415. void setlib(char *libname)
  416.         Sets library filename
  417.  
  418. void setpassword(char *newpassword)
  419.         Sets the library file password
  420.  
  421.  
  422. Timing
  423. ~~~~~~
  424. int wtimer(struct time t,struct time t2)
  425.         Return difference between two times in hundredths of seconds
  426.  
  427. Joystick
  428. ~~~~~~~~
  429. int wcheckjoystick(void)
  430.         Checks to see which joysticks are available
  431.  
  432. void winitjoystick(joystick *joy, int joynum)
  433.         Initializes joystick
  434.  
  435. void wcalibratejoystick(joystick *joy)
  436.         Calibrates joystick, must call twice
  437.  
  438. int wreadjoystick(joystick *joy)
  439.         Reads joystick values into joystick structure
  440.  
  441.  
  442. SoundBlaster VOC
  443. ~~~~~~~~~~~~~~~~
  444. int winitsb(void)
  445.         Initialize digital sound
  446.  
  447. int wsbversion(void)
  448.         Returns driver version
  449.  
  450. void waddr(int base)
  451.         Set I/O address
  452.  
  453. void wirq(int irq)
  454.         Set IRQ number
  455.  
  456. void wdeinitsb(void)
  457.         Shut down digitial sound
  458.  
  459. void wsetspeaker(int onoff)
  460.         Turn speaker on (1) or off (0)
  461.  
  462. void wplayvoc(wgtvoice buffer)
  463.         Plays a VOC file
  464.  
  465. void wsample(wgtvoice buffer, long length)
  466.         Records into buffer
  467.  
  468. void wstopvoc(void)
  469.         Stops VOC from playing
  470.  
  471. void wpausevoc(void)
  472.         Pauses VOC output
  473.  
  474. void wresumevoc(void)
  475.         Resumes VOC output
  476.  
  477. void wfreevoc(wgtvoice vocname)
  478.         Frees memory from voice file
  479.  
  480. wgtvoice wnewvoice(long size)
  481.         Allocs memory for sampling
  482.  
  483. wgtvoice wloadvoc(char *name)
  484.         Loads a VOC file
  485.  
  486.  
  487. SoundBlaster CMF
  488. ~~~~~~~~~~~~~~~~
  489. void wfmsetstatus(unsigned ofs,unsigned seg);
  490.         Set the status variable, automatically set to fmstat
  491.  
  492. unsigned wfmversion(void);
  493.         Return FM driver version
  494.  
  495. void wfmreset(void);
  496.         Resets the CMF driver
  497.  
  498. void wfmstopmusic(void);
  499.         Stops CMF music
  500.  
  501. void wfmsongspeed(unsigned ss);
  502.         Sets tempo of CMF
  503.  
  504. int wfindfm(void);
  505.         Search for the SBFMDRV in memory, and init CMF
  506.  
  507. void wplaycmf(wgtsong song);
  508.         Play CMF file
  509.  
  510. wgtsong wloadcmf(char *loadfile);
  511.         Load CMF file
  512.